package pixiv

import (
	"encoding/json"
	"io/ioutil"
	"net/http"
	"strings"
)

const proxy = "https://i.pixiv.re"

func New() Info {
	info := &lolicon{}
	return info
}

func send[T interface{}](method, url string, data T) {
	client := &http.Client{}
	req, _ := http.NewRequest(method, url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := ioutil.ReadAll(resp.Body)
	json.Unmarshal(body, &data)
}

func replace(url string) string {
	if strings.Contains(url, "https://i.pixiv.cat") {
		return strings.Replace(url, "https://i.pixiv.cat", "", -1)
	}

	return url
}
